import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import Nprogress from 'nprogress'
import 'nprogress/nprogress.css'
import lazyPlugin from 'vue3-lazy'
import imgLoadErrUrl from '@/assets/icon_image_load_err.png'
import config from '@/config/config'
import iconConfig from '@/config/iconConfig'
import appRouterManger from '@/router'
import { store } from '@/store'
// import '@/mock' //与高德地图冲突

Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })

import VConsole from 'vconsole';
const vConsole = new VConsole();

const app = createApp(App)
app
  .use(config)
  .use(iconConfig)
  .use(store)
  .use(appRouterManger.router)
  .use(ElementPlus, { locale: zhCn })
  .use(lazyPlugin, {
    loading: new URL('@/assets/icon_image_loading.png', import.meta.url).href,
    error: imgLoadErrUrl
  })
  .mount('#app')

export default app
